<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template2.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditAtoLegalTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">


            <p:growl id="messages" life="3000"/>

            <h:panelGroup id="messagePanel" styleClass="ajustaListaMensagemErro"  layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="list"/>
            </h:panelGroup>
            <p:panel>
                <f:facet name="header">
                    <h:outputText value="#{bundle.LegendAtoLegalTitle}"></h:outputText>
                </f:facet>

                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditAtoLegalLabel_aleId}" for="aleId" />
                    <p:inplace toggleable="false">
                        <p:inputText id="aleId" value="#{atoLegalController.selected.aleId}" readonly="true" title="#{bundle.EditAtoLegalTitle_aleId}" required="true" requiredMessage="#{bundle.EditAtoLegalRequiredMessage_aleId}"/>
                    </p:inplace>

                    <h:outputLabel value="#{bundle.EditAtoLegalLabel_aleNumero}" for="aleNumero" />
                    <h:panelGroup>
                        <p:inputMask id="aleNumero" mask="9?99999" maxlength="6" value="#{atoLegalController.selected.aleNumero}" title="#{bundle.EditAtoLegalTitle_aleNumero}" required="true" requiredMessage="#{bundle.EditAtoLegalRequiredMessage_aleNumero}"/>

                        <h:outputLabel value="#{bundle.EditAtoLegalLabel_aleAno}" for="aleAno" />  
                        <p:inputMask id="aleAno" mask="9999" maxlength="4"  size="6" required="true" requiredMessage="#{bundle.EditAtoLegalRequiredMessage_aleAno}" value="#{atoLegalController.selected.aleAno}" title="#{bundle.EditAtoLegalTitle_aleAno}" />
                    </h:panelGroup>

                    <h:outputLabel value="#{bundle.EditAtoLegalLabel_aleTalId}" for="aleTalId" />
                    <p:selectOneMenu id="aleTalId" value="#{atoLegalController.selected.aleTalId}"  required="true" requiredMessage="#{bundle.EditAtoLegalRequiredMessage_aleTalId}">
                        <f:selectItems value="#{tipoAtoLegalController.itemsAvailableSelectOne}"/>
                    </p:selectOneMenu>

                    <h:outputLabel value="#{bundle.EditAtoLegalLabel_aleDt}" for="aleDt" />
                    <p:calendar  id="aleDt"  onkeyup="formatar(this, '##/##/####');" locale="#{bundle.localeApp}" maxdate="#{bundle.maxDateCalendar}" size="18" maxlength="10" 
                                 navigator="true" showOn="button" pattern="#{bundle.patternApp}" value="#{atoLegalController.selected.aleDt}" title="#{bundle.EditAtoLegalTitle_aleDt}" >
                        <f:convertDateTime for="aleDt" pattern="#{bundle.patternApp}" timeZone="#{filterSearchController.timeZone}"/>
                    </p:calendar> 

                    <h:outputLabel value="#{bundle.EditAtoLegalLabel_aleStatus}" for="aleStatus" />
                    <p:selectOneMenu value="#{atoLegalController.selected.aleStatus}" id="aleStatus" required="true" requiredMessage="#{bundle.EditAtoLegalRequiredMessage_aleStatus}" >                            
                        <f:selectItem itemLabel="Ativo" itemValue="#{1}"/>
                        <f:selectItem itemLabel="Inativo" itemValue="#{0}"/>
                    </p:selectOneMenu>     


                    <h:outputLabel value="#{bundle.createBy}" for="nomeCriador" rendered="#{not empty atoLegalController.selected.historicoCriacao.nomeUsuario}"/>
                    <h:outputText id="nomeCriador" value="#{atoLegalController.selected.historicoCriacao.nomeUsuario}" rendered="#{not empty atoLegalController.selected.historicoCriacao.nomeUsuario}"/>
                    <h:outputLabel value="#{bundle.createDate}" for="dataCriacao" rendered="#{not empty atoLegalController.selected.historicoCriacao.dataHora}"/>
                    <h:outputText id="dataCriacao" value="#{atoLegalController.selected.historicoCriacao.dataHora}" rendered="#{not empty atoLegalController.selected.historicoCriacao.dataHora}"/>     
                    <h:outputLabel value="#{bundle.updateBy}" for="nomeAlterador" rendered="#{not empty atoLegalController.selected.historicoAlteracao.nomeUsuario}"/>
                    <h:outputText id="nomeAlterador" value="#{atoLegalController.selected.historicoAlteracao.nomeUsuario}" rendered="#{not empty atoLegalController.selected.historicoAlteracao.nomeUsuario}"/>
                    <h:outputLabel value="#{bundle.updateDate}" for="dataAlteracao" rendered="#{not empty atoLegalController.selected.historicoAlteracao.dataHora}"/>
                    <h:outputText id="dataAlteracao" value="#{atoLegalController.selected.historicoAlteracao.dataHora}" rendered="#{not empty atoLegalController.selected.historicoAlteracao.dataHora}" /> 

                </h:panelGrid>


                <br/>
                <p:commandButton ajax="false" rendered="#{!autenticadorController.loginVisualizador}" icon="#{bundle.icone_salvar}" action="#{atoLegalController.update}" value="#{bundle.EditAtoLegalSaveLink}"/> &nbsp;                
                <p:commandButton ajax="false" action="#{atoLegalController.prepareList}" icon="#{bundle.icone_listar}" value="#{bundle.EditAtoLegalShowAllLink}" immediate="true"/>
            </p:panel>                
        </ui:define>
    </ui:composition>

</html>
